home *** CD-ROM | disk | FTP | other *** search
/ Palm Utilities / Palm_Utilities_CD-ROM_2001_2001.iso / files / utils sync / JetSync 1.0 / jetsync-1.0.exe / jetsync-1.0 / src / assert.h next >
Encoding:
C/C++ Source or Header  |  1999-09-11  |  480 b   |  23 lines

  1. #ifndef __ASSERT_H__
  2. #define __ASSERT_H__
  3.  
  4. #include <stdio.h>
  5.  
  6. /* These macros prevent errors from propagating throughout the code.
  7.    They identify the line that caused the error. */
  8.  
  9. #define ASSERT(expr) \
  10.   if (!expr) { \
  11.     printf("FATAL ERROR: Assert failed on line %d (%s)\n", \
  12.             __LINE__,__FILE__); \
  13.     exit(-1); \
  14.   }
  15.  
  16. #define WARN(expr) \
  17.   if (!expr) \
  18.     printf("SEVERE ERROR: Assert failed on line %d (%s)\n", \
  19.             __LINE__,__FILE__);
  20.  
  21.  
  22. #endif
  23.